<template>
  <div class="index-hots-body">
    <div class="list">
      <div v-for="(item,index) in data" :key="index" class="card-box cursor">
        <img class="card-img" :src="item.img">
        <div class="card-title">{{ item.title }}</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    data: Array
  },
  name: "index-hots"
}
</script>

<style scoped>
.index-hots-body {
  width: 100%;
  box-sizing: border-box;
}

.list {
  display: grid;
  width: 100%;
  grid: 250px / auto auto auto auto;
  justify-content: center;
  align-items: center;
}

.card-box {
  height: 250px;
  width: 150px;
  margin: 5px 10px 5px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0 10px;
}

.card-title {
  font-size: 14px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  overflow: hidden;
  display: -webkit-box;
}

.card-img {
  width: 100%;
  height: auto;
  border: 1px solid rgb(225, 225, 225);
}
</style>